<script type="text/javascript">
$(function(){
	$.get("applicationSingle/getCardInfo",function(data){
		var content="<option value='' selected>请选择</option>";
		var i;
		$(data).each(function(n,item){
			for(i=0;i<item.certificates.length;i++){
				content+="<option value="+item.certificates[i].certificateType+">"
				+item.certificates[i].certificatesName+"</option>"
			}
			$("#paperTypeByExchangeCard").html(content);
		});
	},"json");
	
});

//读卡测试卡是否可读，可读则读出信息(余额，证件号，证件类型)
function testIsRead(){
	var flag=activeCPU();
	if(flag){
		flag=qzsmkocx.GetSmkNo();
	}
	var text;
	if(flag){
		text="1";
		alertMsg.correct("您的卡可读");
		$("input[name='citizenCardNo']").val(qzsmkocx.GetRetValue().split(",")[0]);
	}else{
		text="2";
		checkError(getError())
		alertMsg.warn('您的卡不可读！');
	}
	$("input[name='isRead']").val(text);
}
//check是否进行卡测试
function checkReadCard(){
	var value=$("input[name='isRead']").val();
	if(value==""){
		alertMsg.warn('请进行卡片测试');
		return false;
	}
	initCurrentPage();
	return true;
}
</script>

<div class="pageHeader ">
	<form id="pagerForm" method="post" action="exchangeCard/getExchangeCardInfo" class="pageForm required-validate" onsubmit="return validateCallback(this,getExchangeCardInfo);">
		<input type="hidden" name="pageNum" value="" /> 
		<input type="hidden" name="numPerPage" value="" />
		<!-- <input type="hidden" name="pageCount" value="" /> -->
		<div class="searchBar">
			<!-- <table class="searchContent">
			<tr>
				<td><label>测试卡是否可读：</label></td>
				<td style="text-align:left"><input  id="isRead"  class="" type="button" size="30"  value="读卡" onclick="testIsRead()"/></td>
			
				<td><label>证件类型：</label></td>
				<td style="text-align:left"><select id="paperTypeByExchangeCard" name="paperType" class="">
			
				</select></td>
			</tr>
			<tr>
				<td style="text-align:left"><label>证件号码：</label></td>
				<td><input  name="paperNo"  class="digits" type="text" size="30"  /></td>
			
				<td><label>市民卡号：</label></td>
				<td><input  name="citizenCardNo"  class="digits" type="text" size="30"  /></td>
			</tr>
			</table> -->
			<div class="row" style="padding: 0 10px;">
		<div class="col-md-6 col-sm-12" >
			<p ><label>测试卡是否可读：</label><input  id="isRead"  class="newButton" type="button" style="width:12%"  value="读卡" onclick="testIsRead()"/></p>			
		</div>
		<div class="col-md-6 col-sm-12" >
			<p >
			<label>证件类型：</label><select flag="paperCode" id="paperTypeByExchangeCard" name="paperType" class=""></select>
			</p>
		</div>
		</div>
		<div class="row" style="padding: 0 10px;">
		<div class="col-md-6 col-sm-12" >
			<p >
			<label>证件号码：</label><input  name="paperNo"  class="validIdentity" type="text" size="26"  />
			</p>
		</div>
		<div class="col-md-6 col-sm-12" >
			<p >
			<label>市民卡号：</label><input  name="citizenCardNo"  class="validCitizenCardNo" type="text" size="26"  />
			</p>
		</div>
		</div>
		<div class="subBar">
			<ul> 
				<li>
				<div class="buttonActive" ><div class="buttonContent" ><button type="submit" onclick="return checkReadCard();">查询</button></div></div>
				</li>
			</ul>
		</div>
		</div>
	</form>	
</div>

<form method="post" action="exchangeCard/goExchangeRegister" class=""
	onsubmit="return validateCallback(this,navTabAjaxDone);">
	<input name="isRead" type="hidden" value=""> <input
		name="balance" type="hidden" value="">
	<div class="pageContent">
		<div id="ByExchangeCard">
			<table class="table" width="100%" layoutH="298">
				<thead>
					<tr align="center">
						<!-- <th width="2%"><input name="" type="checkbox"
							onclick="checkAllCss(this)" group="exchangeCard"
							class="checkboxCtrl"></th> -->
						<th width="3%">选择</th>
						<th width="15%" class="asc" onclick="order($('#exchangeCard'),1)">市民卡号</th>
						<th width="15%">卡产品</th>
						<th width="10%">卡类型</th>
						<th width="10%">姓名</th>
						<th width="15%">证件类型</th>
						<th width="22%">证件号码</th>
						<th width="10%">卡状态</th>
					</tr>
				</thead>
				<tbody id="exchangeCard">
					<tr>
						<td colspan='7' align='center'>请先读卡查询数据</td>
					</tr>
				</tbody>
			</table>
		</div>
		<!-- 	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select id="numPerPageByExchangeCard" name="numPerPage" onchange="paging(this,$('getExchangeCardInfo'),getExchangeCardInfo)">
				<option value="20">20</option>
				<option value="30">30</option>
				<option value="50">50</option>
				<option value="100">100</option>
			</select>
			<span id="totalCountByExchangeCard" ></span>
		</div>
			<div id="paginationByExchangeCard" class="pagination1"  ></div>
	</div> -->
		<div class="panelBar">
			<div class="pages">
				<span>显示</span> <select class="combox" name="numPerPage"
					onchange="navTabPageBreakCommon({numPerPage:this.value},'exchangeCard',getExchangeCardInfo)">
					<option value="20">20</option>
					<option value="50">50</option>
					<option value="100">100</option>
					<option value="200">200</option>
				</select> <span id="totalCountByExchangeCard">条，共0条</span>
			</div>

			<div callback='getExchangeCardInfo' id="paginationByExchangeCard"
				rel="exchangeCard" class="pagination" targetType="navTab"
				totalCount="0" numPerPage="5" pageNumShown="5" currentPage="0"></div>

		</div>
		<div class="pageFormContent">
			<div class="formBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit" onclick="return validateChechBox5();">换卡登记</button>
							</div>
						</div>
					</li>
				</ul>
			</div>


		</div>
	</div>
</form>


